#-------------------------------------------------------------------
# This file is part of the CMake build system for ogre-aml (Advanced mesh loader for Ogre 3D)
#-------------------------------------------------------------------

project (OgreAML)

# define header files for the library
set (HEADER_FILES
	include/OgreAMLPrecompiledHeader.h
	include/OgreAMLPrerequisites.h
	include/OgreMeshDefinition.h
	include/OgreMeshDefinitionManager.h
)

# define source files for the library
set (SOURCE_FILES
	src/OgreMeshDefinition.cpp
	src/OgreMeshDefinitionManager.cpp
)

# setup precompiled header file, msvc only for now
if (SETUP_ENABLE_PRECOMPILED_HEADERS AND MSVC)
	list (APPEND SOURCE_FILES src/OgreAMLPrecompiledHeader.cpp)
	add_definitions (/YuOgreAMLPrecompiledHeader.h -DOGREAML_ENABLE_PRECOMPILED_HEADERS)
	set_source_files_properties (src/OgreAMLPrecompiledHeader.cpp PPROPERTIES COMPILE_FLAGS /YcOgreAMLPrecompiledHeader.h)
endif (SETUP_ENABLE_PRECOMPILED_HEADERS AND MSVC)

# setup project include directory
include_directories (${CMAKE_CURRENT_SOURCE_DIR}/include)

# setup dependency directories 
# build folder
include_directories (${CMAKE_BINARY_DIR}/include/)
# boost
if (BOOST_IS_REQUIRED)
	include_directories (${Boost_INCLUDE_DIRS})
endif (BOOST_IS_REQUIRED)
# ogre
include_directories (${OGRE_INCLUDE_DIRS})
include_directories (${OGRE_CONFIG_INCLUDE_DIRS})


# setup link directories 
# boost
if (BOOST_IS_REQUIRED)
	link_directories (${Boost_LIBRARY_DIRS})
endif (BOOST_IS_REQUIRED)

# setup OgreAML target
add_library (OgreAML ${OGREAML_LIB_TYPE} ${HEADER_FILES} ${SOURCE_FILES})

# setup link libraries
# ogre
target_link_libraries (OgreAML ${OGRE_LIBRARIES})
# boost
if (BOOST_IS_REQUIRED)
	target_link_libraries (OgreAML ${Boost_THREAD_LIBRARY} ${Boost_DATE_TIME_LIBRARY})
endif (BOOST_IS_REQUIRED)
